package com.ny.demo428;

public class InsurancePolymorphism {
    public static void main(String[] args) {
        // 创建车险实例并计算保费
        CarInsurance carInsurance = new CarInsurance(200000, 1);
        System.out.println("车险保费: " + carInsurance.calculatePremium());

        // 创建家庭基本险实例并计算保费
        HomeInsurance homeInsurance = new HomeInsurance(300000, 120);
        System.out.println("家庭基本险保费: " + homeInsurance.calculatePremium());
    }
}